package com.socialuni.sdk.api;

import com.socialuni.sdk.api.model.QO.talk.*;
import com.socialuni.sdk.api.model.RO.talk.SocialTalkRO;
import com.socialuni.sdk.api.model.ResultRO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;

@RequestMapping("socialuni/talk")
@FeignClient(name = "talk", url = "${social.server-url:https://api.socialuni.com}")
public interface TalkAPI extends FeignAPI {
    @GetMapping("queryTalks")
    ResultRO<List<SocialTalkRO>> queryTalks();

    @PostMapping("queryTalks")
    ResultRO<List<SocialTalkRO>> queryTalks(@RequestBody @Valid @NotNull SocialHomeTalkQueryQO queryVO);

    @PostMapping("addTalk")
    ResultRO<Void> addTalk(@RequestBody @Valid @NotNull SocialTalkAddQO talkVO);

    @PostMapping("deleteTalk")
    ResultRO<Void> deleteTalk(@RequestBody @Valid @NotNull SocialTalkDeleteQO talkVO);

    @PostMapping("queryTalkInfo")
    ResultRO<SocialTalkRO> queryTalkInfo(@RequestBody @Valid @NotNull TalkIdQO talkIdQO);

    @PostMapping("queryUserTalks")
    ResultRO<List<SocialTalkRO>> queryUserTalks(@RequestBody @Valid @NotNull SocialUserTalkQueryQO queryVO);
}